{extend name='admin@public/content'}

{block name="button"}
<!--{if auth("$classuri/add")}-->
<button data-modal='{:url("$classuri/add")}' data-title="新增团检计划" class='layui-btn layui-btn-sm layui-btn-primary'>新增团检计划</button>
<!--{/if}-->
{/block}

{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">申请人</label>
        <div class="layui-input-inline">
            <input name="contacts" value="{$Think.get.contacts}" placeholder="请输入申请人" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">企业名称</label>
        <div class="layui-input-inline">
            <input name="name" value="{$Think.get.name}" placeholder="请输入分类名称" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>

</form>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    <!--{if empty($list)}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{else}-->
    <input type="hidden" value="resort" name="action">
    <table class="layui-table notevent" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-sort-td w60'>ID</th>
            <th>联系人</th>
            <th class="w300">企业名称</th>
            <th class="w150">联系电话</th>
            <th class="w120">预计人数</th>
            <th class="w120">人均预算</th>
            <th class="w150">申请时间</th>
            <th class="w72">状态</th>
            <th class='w120'>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-sort-td w60'>{$vo.id}</td>
            <td>{$vo.contacts}</td>
            <td>{if !empty($vo.enterprise)}[{$vo.enterprise}]{/if}{$vo.name}</td>
            <td>{$vo.contact_number}</td>
            <td>{$vo.persons}</td>
            <td>{$vo.budget}</td>
            <td>{$vo.create_time||date="Y-m-d H:i"}</td>
            <td>{$vo.status_txt}</td>
            <td class='nowrap'>
                {if condition="$vo.status eq 1"}
                {if auth("$classuri/verify")}
                <a data-modal='{:url("$classuri/verify")}?id={$vo.id}' href="javascript:void(0)">审核</a>
                {/if}
                {/if}

                {if condition="$vo.status eq 2"}
                {if auth("$classuri/view")}
                <a data-modal='{:url("$classuri/view")}?id={$vo.id}' href="javascript:void(0)">查看</a>
                {/if}
                {/if}

                {if condition="$vo.status eq 3"}
                <a data-modal='{:url("$classuri/view")}?id={$vo.id}' href="javascript:void(0)">查看</a>
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/remove")}' href="javascript:void(0)">删除</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    <!--{/if}-->
</form>
<script>
    (function () {
        window.form.render();
        window.laydate.render({range: true, elem: '#create_at'});
    })();
</script>
{/block}